<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<ui:composition template="/WEB-INF/templates/template.xhtml"
	xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:a4j="http://richfaces.org/a4j"
	xmlns:rich="http://richfaces.org/rich">

	<ui:define name="menu">
		<h:button value="Home" style=" width : 170px; height : 30px;" outcome = "#{loginController.home}"/>				
		<h:button value="Register" style="width : 170px; height : 30px; margin-top:10px;" outcome = "registerPage" rendered="#{loginController.user}==null"/>
		<h:form><h:commandButton value="Disconnect" style="width : 170px; height : 30px; margin-top:10px;"
		action = "#{loginController.disconnect()}"/></h:form>		
	</ui:define>
	
	<ui:define name="content">		
		<h:outputLabel style="color:#8080FF;font-style:normal;font-size:xx-large;text-decoration:blink;
		font-weight:bold;" value="Welcome Simple User #{userBean.user.login}!!"/>
	<rich:dataTable value="#{adminController.listUsers}" var="user" iterationStatusVar="it" id="table" rows="15">
		            <rich:column>
		                <f:facet name="header">#</f:facet>
		                #{it.index}
		            </rich:column>
		            <rich:column>
		                <f:facet name="header">First Name</f:facet>
		                <h:outputText value="#{user.firstName}" />
		            </rich:column>
		            <rich:column>
		                <f:facet name="header">Last Name</f:facet>
		                <h:outputText value="#{user.lastName}" />
		            </rich:column>
		            <rich:column>
		                <f:facet name="header">Login</f:facet>
		                <h:outputText value="#{user.login}" />
		            </rich:column>
		            <rich:column>
		                <f:facet name="header">Role</f:facet>
		                <h:outputText value="#{user.role}" />
		            </rich:column>
		            <f:facet name="footer">
		                <rich:dataScroller page="#{adminController.page}" />
		            </f:facet>
		        </rich:dataTable>
	</ui:define>
		        
</ui:composition>